/*
 * 文件名：SysUser.java
 * 版权：Copyright by will_awoke
 * 描述：
 * 修改人：will_awoke
 * 修改时间：2014-5-29
 * 跟踪单号：
 * 修改单号：
 * 修改内容：
 */

package com.qbgs.rbac.bean;


import com.alibaba.fastjson.JSON;
import com.qbgs.util.Column;


/**
 * 系统用户
 * 
 * column注解配置与hibernate一致，不过只需要name属性，其他属性不再需要
 * name属性值对应数据库中字段名称，忽略大小写
 * 该注解用于map反向生成modelbean
 * 另请参考：ReflectUtil.java
 * 
 * @author will_awoke
 * @version 2014-5-29
 * @see SysUser
 * @since
 */
public class SysUser
{

    @Column(name = "USER_ID")
    private Long userId;

    @Column(name = "LOGIN_NAME")
    private String loginName;

    @Column(name = "PASSWORD")
    private String password;

    @Column(name = "REAL_NAME")
    private String realName;

    @Column(name = "EMAIL")
    private String email;

    @Column(name = "STATE")
    private String state;

    @Column(name = "REMARKS")
    private String remarks;

    /**
     * 构造器
     */
    public SysUser()
    {

    }

    @Override
    public String toString()
    {
        return JSON.toJSONString(this);
    }

    @Override
    public int hashCode()
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((email == null) ? 0 : email.hashCode());
        result = prime * result + ((loginName == null) ? 0 : loginName.hashCode());
        result = prime * result + ((password == null) ? 0 : password.hashCode());
        result = prime * result + ((realName == null) ? 0 : realName.hashCode());
        result = prime * result + ((remarks == null) ? 0 : remarks.hashCode());
        result = prime * result + ((state == null) ? 0 : state.hashCode());
        result = prime * result + ((userId == null) ? 0 : userId.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj)
        {
            return true;
        }
        if (obj == null)
        {
            return false;
        }
        if (!(obj instanceof SysUser))
        {
            return false;
        }
        SysUser other = (SysUser)obj;
        if (email == null)
        {
            if (other.email != null)
            {
                return false;
            }
        }
        else if (!email.equals(other.email))
        {
            return false;
        }
        if (loginName == null)
        {
            if (other.loginName != null)
            {
                return false;
            }
        }
        else if (!loginName.equals(other.loginName))
        {
            return false;
        }
        if (password == null)
        {
            if (other.password != null)
            {
                return false;
            }
        }
        else if (!password.equals(other.password))
        {
            return false;
        }
        if (realName == null)
        {
            if (other.realName != null)
            {
                return false;
            }
        }
        else if (!realName.equals(other.realName))
        {
            return false;
        }
        if (remarks == null)
        {
            if (other.remarks != null)
            {
                return false;
            }
        }
        else if (!remarks.equals(other.remarks))
        {
            return false;
        }
        if (state == null)
        {
            if (other.state != null)
            {
                return false;
            }
        }
        else if (!state.equals(other.state))
        {
            return false;
        }
        if (userId == null)
        {
            if (other.userId != null)
            {
                return false;
            }
        }
        else if (!userId.equals(other.userId))
        {
            return false;
        }
        return true;
    }

    //setter getter
    public Long getUserId()
    {
        return userId;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public String getLoginName()
    {
        return loginName;
    }

    public void setLoginName(String loginName)
    {
        this.loginName = loginName;
    }

    public String getPassword()
    {
        return password;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getRealName()
    {
        return realName;
    }

    public void setRealName(String realName)
    {
        this.realName = realName;
    }

    public String getEmail()
    {
        return email;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }

    public String getState()
    {
        return state;
    }

    public void setState(String state)
    {
        this.state = state;
    }

    public String getRemarks()
    {
        return remarks;
    }

    public void setRemarks(String remarks)
    {
        this.remarks = remarks;
    }

}
